home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / lib_test / test_integer_ref.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  894 b   |  51 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_INTEGER_REF
  5.  
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    make is
  12.       local
  13.      i: INTEGER;
  14.      ir: INTEGER_REF;
  15.      a: ANY;
  16.      aa: ARRAY[ANY];
  17.       do
  18.      ir := 2;
  19.      is_true(ir.item = 2);
  20.      a := 2;
  21.      is_true(equal(a,ir));
  22.      is_true(equal(ir,2));
  23.      is_true(equal(a,2));
  24.      
  25.      !!aa.make(1,1);
  26.      aa.put(26,1);
  27.      is_true(equal(aa.item(1),26));
  28.      
  29.      i := 5;
  30.      ir := i;
  31. -- ???     is_true(i = ir);
  32.          
  33. -- ???     is_true(26 = aa.item(1));
  34.       end;
  35.    
  36.    is_true(b: BOOLEAN) is
  37.       do
  38.      cpt := cpt + 1;
  39.      if not b then
  40.         std_output.put_string("TEST_INTEGER_REF: ERROR Test # ");
  41.         std_output.put_integer(cpt);
  42.         std_output.put_string("%N");
  43.      else
  44.         --        std_output.put_string("Yes%N");
  45.      end;
  46.       end;
  47.    
  48.    cpt: INTEGER;
  49.    
  50. end -- TEST_INTEGER_REF
  51.